package com.z.mapper;

import com.z.entity.AuRoles;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zz
 * @since 2021-08-13
 */
@Mapper
public interface AuRolesMapper extends BaseMapper<AuRoles> {

    @Select("select roles.role_id,roles.role_desc,roles.role_name from au_roles roles " +
            "inner join au_inner_user_role aiur on aiur.role_id = roles.role_id " +
            "INNER JOIN users ON aiur.user_id = users.user_id where users.user_id = #{adminId};")
    List<AuRoles> selectRolesByUserId(Integer adminId);
}
